/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farent.solutions.jeeunit;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Farouk.Alhassan
 */
public class JeeUnitConfiguration {
    
    private static String filename = "/jeeunit.properties";
    
    private static Properties properties;
    
    private JeeUnitConfiguration() {
        try {
            InputStream propFile = JeeUnitConfiguration.class.getResourceAsStream(filename);
            properties = new Properties();
            properties.load(propFile);
        } catch (IOException ex) {
            throw new RuntimeException(filename + " not found! Please initialialize jeeunit properly.");
        }
    }
    
    public static JeeUnitConfiguration getInstance() {
        return JeeUnitConfigurationHolder.INSTANCE;
    }
    
    private static class JeeUnitConfigurationHolder {

        private static final JeeUnitConfiguration INSTANCE = new JeeUnitConfiguration();
    }
    
    public String getValue(String key)
    {
        return properties.getProperty(key);
    }
}
